/**
 * 抽奖结果浮层
 */
import React from "react";
import {Link} from 'react-router';
export class ModalWin extends React.Component {
    render() {
        return (
            <div className="pages modal-win">
                <div className="btn-close" onClick={e=>this.props.onClosing(e)}></div>
                <div className="content">
                    <h1 className="title">恭喜您！</h1>
                    <hr/>
                    <img src={this.props.win.prize.image} className="image" alt=""/>
                    <div className="prize">奖品：{this.props.win.prize.title}（{this.props.win.prize.desc}）</div>
                    <div className="capture">验证码：{this.props.win.code}</div>
                    <Link className="btn-red components btn-action btn-award" to="/exchange-rule">自助领奖</Link>
                    <div className="assist-award" onClick={()=>this.props.onServiceClicked()}>
                        客服协助领奖 &gt;&gt;</div>
                    <div className="tips"><span className="strong">提示：</span>请保存验证码（截屏），用于奖品领取 <br/>每个用户限摇奖一次</div>
                </div>
            </div>
        )
    }
}
export class ModalLose extends React.Component {
    render() {
        return (
            <div className="pages modal-lose">
                <div className="btn-close" onClick={e=>this.props.onClosing(e)}></div>
                <div className="content">
                    <h1 className="title">{this.props.title}</h1>
                    <hr/>
                    <div className="message">{this.props.text}</div>
                    <div className="btn-red components btn-action btn-replay" onClick={e=>this.props.onClosing(e)}>
                        {this.props.btnText}
                    </div>
                </div>
            </div>
        )
    }
}
ModalWin.propTypes = {
    onClosing: React.PropTypes.func.isRequired,
    win: React.PropTypes.object.isRequired,
    onServiceClicked:React.PropTypes.func.isRequired
};
ModalLose.propTypes = {
    onClosing: React.PropTypes.func.isRequired,
    text: React.PropTypes.string.isRequired,
    btnText: React.PropTypes.string,
    title: React.PropTypes.string
};

ModalLose.defaultProps = {
    title: '很遗憾！',
    btnText: '再次摇奖'
};